package tcln.sors.model.core.type;

import javax.persistence.Embeddable;

/**
 * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
 */
@Embeddable
public class CurrencyAmount {
    private Double amount;
    private String currencyCode;

    /**
     * default constructor.
     */
    public CurrencyAmount() {
        //
    }

    /**
     * @param amount
     * @param currencyCode
     */
    public CurrencyAmount(Double amount, String currencyCode) {
        this.amount = amount;
        this.currencyCode = currencyCode;
    }
    
    /**
     * @param amount
     * @param currencyCode
     */
    public CurrencyAmount(Double amount, SupportedCurrencyCode currencyCode) {
        this(amount, currencyCode.name());
    }

    /**
     * Returns current value of {@link #amount}.
     * 
     * @return the {@link #amount}.
     */
    public Double getAmount() {
        return amount;
    }

    /**
     * Sets new value for {@link #amount}.
     * 
     * @param amount
     *            the new amount to set
     */
    public void setAmount(Double amount) {
        this.amount = amount;
    }

    /**
     * Returns current value of {@link #currencyCode}.
     * 
     * @return the {@link #currencyCode}.
     */
    public String getCurrencyCode() {
        return currencyCode;
    }

    /**
     * Sets new value for {@link #currencyCode}.
     * 
     * @param currencyCode
     *            the new currencyCode to set
     */
    public void setCurrencyCode(String currencyCode) {
        this.currencyCode = currencyCode;
    }
}
